Method, device, and system for guaranteed minimum processor power state dwell time

ABSTRACT

A method, device, and system are disclosed. In one embodiment the method includes causing a processor to enter into a first power state. Then an interrupt is received that signals the processor to leave the first power state. The method continues by causing the processor to remain in the first power state if the interrupt was received less than a minimum dwell time after the processor entered the first power state.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a continuation of and claims priority to U.S. patentapplication Ser. No. 12/215,757 entitled, “METHOD, DEVICE, AND SYSTEMFOR GUARANTEED MINIMUM PROCESSOR POWER STATE DWELL TIME” which was filedon Jun. 30, 2008; this application is entirely incorporated byreference.

FIELD OF THE INVENTION

The invention relates to guaranteeing a dwell time in a processor powerstate.

BACKGROUND OF THE INVENTION

Many modern processors have multiple power states, which can be utilizedto balance the needed performance of the processor against the power theprocessor consumes. Some power states are relatively efficient to enterinto and exit from. Other power states have significant and power hungryrequirements for performing the entry and exit processes. With aparticular workload, certain processors can become power inefficient ifthey are continually forced to enter and exit a power state that hashighly power inefficient entry and exit processes.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention is illustrated by way of example and is notlimited by the drawings, in which like references indicate similarelements, and in which:

FIG. 1 describes an embodiment of a device and computer system capableof providing a minimum dwell time in a power state to gain greateraverage power consumption efficiency while in the state.

FIG. 2 is a flow diagram of an embodiment of a process to transitionbetween a C0 processor power state and a C6 processor power state whileusing a programmable dwell time while in the C6 processor power state.

DETAILED DESCRIPTION OF THE INVENTION

Embodiments of a method, device, and system for enforcing a minimumdwell time a processor must remain in a particular power state aredisclosed. The processor can enter a power state that has an associatedminimum dwell time. Once the processor is in the power state with theminimum dwell time, the processor must remain in that state until theminimum dwell time has passed. Thus, any interrupts (i.e. break events)that would otherwise cause the processor to immediately exit the powerstate will not be honored until the minimum dwell time has passed.Rather, the break event(s) will be held in waiting and then allowed toproceed to cause the processor to exit the power state when theprocessor has been at least been in the power state for the duration ofthe minimum dwell time.

Reference in the following description and claims to “one embodiment” or“an embodiment” of the disclosed techniques means that a particularfeature, structure, or characteristic described in connection with theembodiment is included in at least one embodiment of the disclosedtechniques. Thus, the appearances of the phrase “in one embodiment”appearing in various places throughout the specification are notnecessarily all referring to the same embodiment.

In the following description and claims, the terms “include” and“comprise,” along with their derivatives, may be used, and are intendedto be treated as synonyms for each other. In addition, in the followingdescription and claims, the terms “coupled” and “connected,” along withtheir derivatives may be used. It should be understood that these termsare not intended as synonyms for each other. Rather, in particularembodiments, “connected” may be used to indicate that two or moreelements are in direct physical or electrical contact with each other.“Coupled” may mean that two or more elements are in direct physical orelectrical contact. However, “coupled” may also mean that two or moreelements are not in direct contact with each other, but yet stillcooperate or interact with each other.

FIG. 1 describes an embodiment of a device and computer system capableof providing a minimum dwell time in a power state to gain greateraverage power consumption efficiency while in the state.

The term “average power consumption” refers to the average amount ofpower consumed by a processor or other integrated circuit over a periodof time. For example, if a processor consumes a total of 20 Joules overthe course of 10 seconds, the processor's average power consumption is 2Joules per second, or 2 W. Thus, although a certain processor powerstate may lead to a lower average power consumption over a long periodof time, the process required to enter the processor into that state mayconsume a much more significant amount of energy. Therefore, if theaverage power consumption of a processor is taken over a fairly shortperiod of time around the entry point into the power state, then theaverage power consumption may be significantly higher than what it wouldotherwise be if averaged over a greater length of time.

In different embodiments, the computer system may be a desktop computer,a server computer, a laptop computer, a handheld electronic device, atelevision set top computer, an integrated computer within an applianceor vehicle, or any other type of conceivable computer system within thescope of the various embodiments described below.

In many embodiments, the computer system includes a processor 100. Theprocessor may include a single core such as core 102, or have multiplecores, such as cores 102 and 104 (or more). A cache memory 106 alsoresides on the processor die. The cache memory 106 may include multiplelevels of cache, such as a level 1 cache and a level 2 cache.Furthermore, when there are multiple cores in the processor, each of thedifferent levels of cache memory 106 may be shared or there may be acache memory per core in different embodiments.

In some embodiments, the processor 100 may be an Intel® architecturemicroprocessor. In some embodiments, the processor 100 may include IntelSpeedStep® technology or another power management-related technologythat provides for two or more voltage/frequency operating points. Insome embodiments, the processor 100 may be a different type of processorsuch as an embedded processor or a digital signal processor.

Additionally, the processor also has an integrated memory controller 108in many embodiments. The memory controller 108 is coupled through aprocessor-memory interconnect to system memory 110. The memorycontroller 108 enables the processor 100 and any other devices in thecomputer system to access system memory 110. In many embodiments, systemmemory 110 may comprise a form of random access memory (RAM) such asdynamic RAM (DRAM), flash memory, or another form of memory.

The processor also is coupled to a discrete input/output (I/O) complex112 in many embodiments. In other embodiments that are not shown, theI/O complex may be integrated into the processor. The I/O complex 112may include one or more integrated I/O host controllers (not shown) thatallow I/O devices such as keyboards, mass storage devices, etc. toconnect to the computer system.

The system also includes a voltage regulating meter (VRM) 114, which iscoupled to the processor 100. The VRM 114 supplies a power operatingvoltage to the processor and may operate in accordance with a version ofthe Intel® Mobile Voltage Positioning (IMVP) specification such as theIMVP-6 specification. In many embodiments, different components withinthe processor as well as different units within the processor core maybe coupled to different power planes in the processor. When there ismore than one power plane designed into the processor, the VRM 114 mayhave the capability to change the delivered voltage to the two or moreplanes independently. This may allow portions of the processor to powerdown while other portions remain powered. The VRM 114 may include logicthat is responsive to one or more signals to reduce voltage to theprocessor 100, including down to a zero voltage state. The VRM 114 logicmay also ramp the voltage to the processor 100 back up again afterexiting the zero voltage state. Furthermore, in other embodiments thatare not shown, the VRM 114 may be integrated into the processor 100.

In some embodiments, the processor 100 has a dedicated save state staticRAM (SRAM) memory 116 that may be used to store the processor's stateinformation when the processor is to enter into a low voltage state or azero voltage state. To accomplish this, the save state SRAM memory 116is located on a separate voltage plane than the majority of the rest ofthe processor 100. The processor 100 also includes power state entry andexit logic 118 to control entry into and exit from a low or zero voltagestate. Each power state includes a specific voltage that is used as theoperating voltage fed to the processor from the VRM 114. Each specificvoltage may be programmed into the VRM 114 using a voltage ID (VID)value. In many embodiments, a power state VID is paired with a specificprocessor operating frequency. Thus, in many embodiments, a power statetable that stores voltage/frequency pairs is stored in the computersystem. This table may be located within microcode in the processor 100,in storage within the I/O complex 112, in BIOS (basic input/outputsystem) 122, or in other firmware in the system.

In many embodiments, when the computer system is operational, anoperating system 124 is loaded into system memory 110. The operatingsystem may include code to support an Advanced Configuration and PowerInterface (ACPI) 126. Using this code, the operating system may haveaccess to the power state table and command the ACPI interface to enterand exit different power states.

The I/O Complex 112 also includes a power management microcontroller 128in many embodiments. The power management microcontroller 128 includesstate control logic that may control transitions between powermanagement states and normal operational states that are associated withthe processor 100. For example, many Intel® architecture processors havea normal operational state referred to as C0. C0 generally has a highfrequency mode (HFM) and a low frequency mode (LFM). On the other end ofthe power management spectrum, many Intel® architecture processors havea zero voltage processor “deep sleep” state referred to as C6.

At a time when the processor is running in the C0 state, an ACPI commandfrom the operating system or from elsewhere in the computer system maybe sent to the power management microcontroller 128 to bring theprocessor 100 down to the C6 state. In some embodiments, if theprocessor 100 is in the C0 HFM, it is first brought down to the C0 LFM.Then once in the C0 LFM power state, the power managementmicrocontroller 128 may initiate the processor's entry into the C6 powerstate.

Specifically, the power management microcontroller 128 may send a signalto the power state entry and exit logic 118 in the processor 100 toinitiate the steps to bring the processor to the C6 state. Prior tosending the processor into the C6 state, the processor requires severalprocessor cycles to prepare to enter the state. The processor caches areflushed and then the processor architectural state is saved to preparethe processor 100 for the C6 state. The details of the process toprepare the processor for the C6 state are discussed in greater detailbelow in regard to the discussion related to FIG. 2. Once the processorhas been prepared, the power management microcontroller 128 may thensend a signal to voltage sleep logic 130 within the VRM 114 to begin thevoltage ramp down from the C0 LFM state to the C6 state.

In the C6 state, the processor core voltage is reduced to zero for themajority of the processor 100, including the voltage to the core and thevoltage to the caches. Additionally, the core clock is turned off andthe phase locked loop (PLL) supplying the core is turned off. Toaccomplish this, the power management microcontroller 128 can send asignal to stop a clock generator 132 supplying the processor with asystem timer signal. The system timer signal provides timer ticks to theprocessor at a given rate.

Generally, the processor 100 will remain in the C6 state until a wakeevent arrives and the power management microcontroller 128 will thenbegin the wakeup process. The C6 to C0 wake up process starts by rampingthe voltage supplied to the processor 100 up to the C0 LFM state andthen restoring the architectural state of the processor.

The total energy consumption cost to enter and then exit the C6 state issignificant because this process includes flushing the processor caches,saving the architectural state of the processor, ramping down thevoltage, then ramping up the voltage and restoring the state of theprocessor. Depending on the workload presented to the processor 100, C6entry events and exit events spaced less than a certain number ofprocessor cycles apart from each other can lead to greater averageprocessor power consumption over a particular period of time than anon-zero voltage state, such as the C4 state.

The processor 100 does not have as great of a energy cost overheadentering and exiting the C4 state. For example, in the C4 state, thecore voltage does not decrease to zero when in the state, thus, thevoltage ramp time from C0 to C4 and back to C0 is less than the voltageramp time from C0 to C6 and back to C0. Furthermore, the processorcaches are not flushed during preparation for entering the C4 state, sothe caches still receive power in the C4 state.

Thus, because of the high energy consumption overhead related toentering and exiting the C6 state, there generally exists an interruptrate/average power consumption cross-over point between the C6 state andthe C4 state. When the interrupt rate is more frequent than thecross-over point, the average processor power consumption using the C4state is less than the average power consumption using the C6 state. Asthe processor interrupt rate decreases so that the interrupt rate isless frequent than the cross-over point, the average processor powerconsumption using the C4 state is greater than the average powerconsumption using the C6 state. Therefore, if there is a high frequencyof processor interrupts, it becomes a disadvantage to enter the C6state. In some embodiments, the interrupt rate cross-over point is knowndue to previous testing of the processor. When the interrupt rate is setto a rate that causes the average power consumption of the processor inthe C6 state to equal the average power consumption of the processor inthe C4 state over a given period of time, then the interrupt rate is setat a break-even power consumption value.

Due to the C6 entry/exit average power consumption overhead, the powermanagement microcontroller 128 can implement a minimum C6 dwell timevalue. This value can provide a guarantee that the processor will stayin the C6 state for a minimum amount of time. Thus, upon entering the C6state, a timer is started in some embodiments. In other embodiments, themoment the processor enters the C6 state a value of a system timer notaffected by the C6 state is saved. The C6 minimum dwell time value canthen be added to the value of the timer. The result (i.e. the minimumvalue the timer must be before beginning the process of leaving the C6state) can be used to compare to the system timer and if a break event(i.e. interrupt) to remove the processor from the C6 state is receivedprior to the result value, the break event can be held back from causingthe exit from C6 process. In other words, if a processor interruptarrives prior to the timer reaching the minimum C6 dwell time, then theinterrupt is not serviced immediately.

In many embodiments, interrupts can accumulate in an interrupt queue.Additionally, the minimum C6 dwell time may be programmed such that nomore than one additional system timer tick is held off. If the systemtimer is held off for more than one additional timer tick, the systemmay accrue drift error due to interrupts not being serviced withsufficient frequency. Therefore, the minimum C6 dwell time may have arange of values from zero (i.e. when the minimum C6 dwell time isdisabled) up to a maximum dwell time—a time that above which would causethe system timer to be held off for two or more system timer ticks.

The minimum C6 dwell time value may be stored in a register within thepower management microcontroller 128, stored in the BIOS 122, or storedelsewhere within the computer system. The minimum C6 dwell time valuecan be programmed dynamically during operation of the computer systemusing software controlled by the OS 124, controlled by the processormicrocode 120, or elsewhere. Alternatively, the minimum C6 dwell timecan be programmed once at system start up by the BIOS 122.

FIG. 2 is a flow diagram of an embodiment of a process to transitionbetween a C0 processor power state and a C6 processor power state whileusing a programmable dwell time while in the C6 processor power state.The process is performed by processing logic which may comprisehardware, software, or a combination of both. The processor begins theprocess in a C0 LFM power state. In some embodiments, if the processoris in a C0 HFM state, prior to the process beginning, the powermanagement microcontroller or other power managing logic within thecomputer system transitions the processor from the C0 HFM state to theC0 LFM state.

Thus, when the processor starts the process, it has a power suppliedvoltage (Vcc) that is the C0 LFM voltage. Turning now to FIG. 2, theprocess begins by processing logic servicing an interrupt serviceroutine (ISR) while in the C0 LFM state (processing block 200). This ISRinforms the processor prepare to enter the C6 state. Then processinglogic within the processor flushes the processor caches (processingblock 202). In some embodiments, the cache flush includes theprocessor's L1 and L2 caches.

Next, processing logic saves the state of the processor (processingblock 204). The state of the processor may include saving informationsuch as critical register values and current pipeline information withinthe processor core to maintain the state of the processor currently. Theprocessor state is saved in an SRAM that is powered by a separate powerplane than the plane that powers the majority of processor including theexecution unit, caches, clocks, etc. Thus, when the main power planethat powers the majority of the processor is powered down, the SRAMpower plane remains powered up and maintains the critical processorstate information at a minimal power consumption cost. In manyembodiments, there are additional specific processing steps required toprepare the processor for the C6 state. These additional steps can befound in documentation related to one or more processors that arecapable of utilizing the C6 processor power state.

Processing logic then begins the main processor voltage (Vcc) ramp downto the C6 Vcc (processing block 206). In some embodiments this is a zerovoltage state. In other embodiments, the state includes a very minimalpositive voltage value such as 0.3V. Once the voltage has completed theramp down and arrives at the C6 Vcc value, processing logic begins totrack the C6 dwell time (processing block 208). The C6 dwell time is afully programmable time that has a lower limit (zero) when the C6minimum dwell time logic is disabled and an upper limit. The upper limitof the C6 minimum dwell time is an amount of time within the C6 statethat puts a two system timer tick limit on the time it takes to bringthe processor from the operational C0 LFM state, down to the C6 state,and back up to the operational C0 LFM state. In other words, processingblocks 200-206 (i.e. the blocks that prepare and then bring theprocessor from the operational C0 LFM state to the C6 state) andprocessing blocks 210-216 (i.e. the blocks that bring the processor fromthe C6 state back up to an operational C0 LFM state) each have a finiteand mostly deterministic time requirement to process. The only variablevalue within the entire process is the C6 dwell time value at block 208.Thus, the upper limit (UL) of the programmable C6 minimum dwell time(MDT) would be the following equation:

UL of C6 MDT=2 system timer ticks−(sum of 200-206&210-216 time reqs)

After the C6 dwell time, processing logic then begins the processor Vccramp up from the C6 Vcc level to the C0 LFM Vcc level (processing block210). After the Vcc level has returned to the C0 LFM Vcc level,processing logic does a PLL relock routine to get a valid clock signalin the processor (processing block 212). The PLL relock is requiredbecause the PLL supplying the processor with the clock signal is turnedoff during the C6 state to save additional power.

Once the PLL has been relocked and a valid clock is available in theprocessor, processing logic then performs an internal RESET of theprocessor (processing block 214). The internal RESET allows theprocessor to reset the hardware and begin operating normally again.After the hardware has been reset, processing logic then restores thestate of the processor that was previously saved in block 206(processing block 216). When the state is restored, the processor canbegin normal operations again as it left them when the initial ISR wasserviced in block 200 and the process is finished.

In many embodiments, the average power consumption of the processor istracked across a rolling window of time and the C6 minimum dwell timevalue is increased or decreased dynamically in response to the averagepower consumption of the processor. For example, if a certain workloadis causing frequent entry and exits to and from the C6 power state,logic within the power management microcontroller may realize that theworkload is causing severe power spikes due to the entry and exit C6power requirements. This may lead the power management microcontrollerto increase the C6 minimum dwell time so that once in the C6 state, theprocessor must remain there until the average power consumption makes itbeneficial to have entered the state in the first place. Alternatively,if there are very few entries into the C6 state, the power managementmicrocontroller may reduce the C6 minimum dwell time to increaseprocessor performance.

In other embodiments, the dwell time may not be confined to the C6state. Rather, any two processor power states may have an interrupt ratecross-over point for power efficiency where interrupts arriving at arate greater than the cross-over point may lead to greater powerefficiency in a first state whereas interrupts arriving at a rate lessthan the cross-over point may lead to greater power efficiency in asecond state. If the cross-over point for two given states is known, theminimum dwell time in one of the states can be increased or decreased asneeded to provide for less average power consumption whenever theprocessor is in the given state. Because this process is designed toprovide the processor with greater average power consumption efficiencyin a given state, this process may not lead to the highest performancein the processor. Thus, a tradeoff between performance and power maysometimes be necessary.

Thus, embodiments of a method, device, and system for enforcing aminimum dwell time a processor must remain in a particular power stateare disclosed. These embodiments have been described with reference tospecific exemplary embodiments thereof. It will be evident to personshaving the benefit of this disclosure that various modifications andchanges may be made to these embodiments without departing from thebroader spirit and scope of the embodiments described herein. Thespecification and drawings are, accordingly, to be regarded in anillustrative rather than a restrictive sense.

1. A method, comprising: causing a processor to enter into a first powerstate; receiving an interrupt to signal the processor to leave the firstpower state; and causing the processor to remain in the first powerstate if the interrupt was received less than a minimum dwell time afterthe processor entered the first power state.
 2. The method of claim 1,further comprising: determining an average power consumption of theprocessor over a determined length of time in the first power state; andincreasing the minimum dwell time when the average power consumption isgreater than a determined break even power consumption value.
 3. Themethod of claim 2, wherein the determined break even power consumptionvalue further comprises an average power consumption of the processorover the determined length of time in a second power state.
 4. Themethod of claim 1, further comprising: determining an average timebetween interrupts to the processor over a determined length of time inthe first power state; and increasing the minimum dwell time when theaverage time between interrupts is less than a determined break eveninterrupt rate value.
 5. The method of claim 4, wherein the determinedbreak even interrupt rate value further comprises an interrupt rate atwhich an average power consumption of the processor in the first powerstate over a determined length of time is equal to an average powerconsumption of the processor over the determined length of time in asecond power state.
 6. The method of claim 1, further comprisingprogramming the minimum dwell time dynamically during operation of theprocessor.
 7. A device, comprising: a power management microcontrollerto: cause a processor to enter into a first power state, the processorto receive an interrupt to signal the processor to leave the first powerstate; and; cause the processor to remain in the first power state ifthe interrupt was received less than a minimum dwell time after theprocessor entered the first power state.
 8. The device of claim 7,wherein the power management microcontroller is operable to: determinean average power consumption of the processor over a determined lengthof time in the first power state; and increase the minimum dwell timewhen the average power consumption is greater than a determined breakeven power consumption value.
 9. The device of claim 8, wherein thedetermined break even power consumption value further comprises anaverage power consumption of the processor over the determined length oftime in a second power state.
 10. The device of claim 7, wherein thepower management microcontroller is operable to: determine an averagetime between interrupts to the processor over a determined length oftime in the first power state; and increase the minimum dwell time whenthe average time between interrupts is less than a determined break eveninterrupt rate value.
 11. The device of claim 10, wherein the determinedbreak even interrupt rate value further comprises an interrupt rate atwhich an average power consumption of the processor in the first powerstate over a determined length of time is equal to an average powerconsumption of the processor over the determined length of time in asecond power state.
 12. The device of claim 7 wherein the powermanagement microcontroller is operable to: program the minimum dwelltime dynamically during operation of the processor.
 13. A system,comprising: an interconnect; a processor coupled to the interconnect;and a memory coupled to the interconnect, the memory to store softwareto program a minimum dwell time for the processor in a C6 power state;and a power management microcontroller, coupled to the interconnect, thepower management microcontroller to: cause the processor to enter intothe C6 power state; receive an interrupt to signal the processor toleave the C6 power state; and; cause the processor to remain in the C6power state if the interrupt was received less than a minimum dwell timeafter the processor entered the C6 power state.
 14. The system of claim13, wherein the power management microcontroller is operable to:determine an average power consumption of the processor over adetermined length of time in the C6 power state; and increase theminimum dwell time when the average power consumption is greater than adetermined break even power consumption value.
 15. The system of claim14, wherein the determined break even power consumption value furthercomprises an average power consumption of the processor over thedetermined length of time in a second power state.
 16. The system ofclaim 13, wherein the power management microcontroller is operable to:determine an average time between interrupts to the processor over adetermined length of time in the C6 power state; and increase theminimum dwell time when the average time between interrupts is less thana determined break even interrupt rate value.
 17. The system of claim16, wherein the determined break even interrupt rate value furthercomprises an interrupt rate at which an average power consumption of theprocessor in the C6 power state over a determined length of time isequal to an average power consumption of the processor over thedetermined length of time in a second power state.
 18. The system ofclaim 13 wherein the power management microcontroller is operable to:program the minimum dwell time dynamically during operation of theprocessor.
 19. The system of claim 13, wherein the power managementmicrocontroller further comprises: a minimum dwell time register tostore the programmed minimum dwell time.
 20. The system of claim 19,further comprising: a basic input/output system (BIOS) to program theminimum dwell time register during system boot.